//
//  SpecialNodeCCell.m
//  ImGuider
//
//  Created by 李陆涛 on 2017/12/26.
//  Copyright © 2017年 imguider. All rights reserved.
//

#import "SpecialNodeCCell.h"

@interface SpecialNodeCCell ()
@property (weak, nonatomic) IBOutlet UIImageView *specialImageView;

@property (weak, nonatomic) IBOutlet UILabel *specialNameLabel;

@property (weak, nonatomic) IBOutlet UIImageView *guiderImageView;
@property (weak, nonatomic) IBOutlet UIImageView *guiderVipImageView;

@property (weak, nonatomic) IBOutlet UIView *mengbanView;
@property (weak, nonatomic) IBOutlet UILabel *spotCountLabel;
@end

@implementation SpecialNodeCCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.mengbanView.backgroundColor = kMengBanColor;
}

- (void)setModel:(LineModel *)model {
    
    _model = model;
    
    [self.specialImageView setImageURL:[NSURL URLWithString:[model.pictureArray firstObject]] placeholderImage:kPlaceholderRec];
    self.specialNameLabel.text = model.linename;
    [self.guiderImageView setImageURL:[NSURL URLWithString:model.guide.headimg] placeholderImage:[UIImage imageNamed:@"default"]];
    self.guiderVipImageView.hidden = !model.guide.vip;
    
    NSString *str1 = model.recordcount;
    NSString *str2 = MYLocalizedString(@"MYDOWNLOAD_SPECIAL", nil);
    
    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",str1,str2]];
    
    [attrStr addAttribute:NSFontAttributeName value:FontBold(18) range:str1.rangeOfAll];
    [attrStr addAttribute:NSFontAttributeName value:Font(12) range:NSMakeRange(str1.length, str2.length)];
    self.spotCountLabel.attributedText = attrStr;
}

@end
